package com.bnz.service.impl;

import com.bnz.mapper.ClassesMapper;
import com.bnz.pojo.Classes;
import com.bnz.service.ClassesService;
import com.bnz.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;


public class ClassesServiceImpl implements ClassesService {
	//1. 得到所有的班级
	@Override
	public List<Classes> findAll() {
		try(SqlSession sqlSession = MyBatisUtil.getSqlSession()){
			ClassesMapper classesMapper = sqlSession.getMapper(ClassesMapper.class);
			return classesMapper.findAll();
		}
	}
}
